Skip to content

feat(cli): add a studio subcommand behind the studio feature - #459

Merged
LeadcodeDev merged 1 commit into
mainfrom
feature/studio-subcommand
Sep 30, 2026
Merged

LeadcodeDev merged 1 commit into
mainfrom
feature/studio-subcommand

Conversation

@LeadcodeDev

Copy link
Copy Markdown
Owner

cargo install --features studio built the studio but left it reachable only as a second binary, so the first name anyone tries — rustmotion studio — answered unrecognized subcommand. That is what a user reported.

rustmotion studio now opens it, taking the same -f / -d as rustmotion-studio. The standalone binary is unchanged and still installed by the same feature; removing it would break anyone who scripted it, and it costs four lines.

The variant is compiled either way, and #[cfg_attr(not(feature = "studio"), command(hide = true))] keeps it out of --help when the feature is off, which is what CLAUDE.md asks for. Typing it anyway then gets:

Error: this build of rustmotion has no studio: it is behind the `studio` feature, which is off by default because it pulls gpui and a native GUI toolchain. Reinstall with it on:
  cargo install --git https://github.com/LeadcodeDev/rustmotion --features studio

Gating the variant out entirely was the other option and was rejected: it produces unrecognized subcommand 'studio', which is the message that caused the report. A hidden subcommand advertises nothing and still explains itself.

studio::run called Cli::parse() on the process argv, which would have failed on the studio token, so its body moved to run_with(file, dir) and both entrypoints call that. studio::command() had no caller anywhere in the repo and was removed.

Verification — tests/studio_subcommand.rs drives the built binary and splits on the feature: with it, studio is in the subcommand list and studio --help carries --file and --dir; without it, no studio line in --help, and rustmotion studio exits non-zero naming --features studio and not unrecognized subcommand. Run both ways, plus cargo fmt --all --check, cargo clippy --workspace --all-targets with and without --features rustmotion/studio, and cargo test --workspace --features rustmotion/studio (0 failed). CI only runs clippy with the feature on, so the feature-off branch was checked locally.

Closes #458

The studio shipped as a second binary, so a CLI built with `--features
studio` answered `unrecognized subcommand 'studio'` to the one name a
user would try first. `rustmotion studio` now opens it, with the same
`-f` / `-d` as `rustmotion-studio`, which stays installed for anyone who
scripted it.

Without the feature the variant is still compiled, hidden from `--help`
per the rule already in CLAUDE.md, and dispatched to the `cargo install
--features studio` line. A subcommand that names the flag granting it is
the whole reason the report came in; `unrecognized subcommand` names
nothing.

`studio::run` parsed its own argv, which would have choked on the
`studio` token, so the body moved to `run_with(file, dir)` and both
entrypoints call it. `studio::command()` had no caller and went with it.

Closes #458
@LeadcodeDev LeadcodeDev self-assigned this Sep 30, 2026
@LeadcodeDev
LeadcodeDev merged commit 3b9eacc into main Sep 30, 2026
4 checks passed
@LeadcodeDev
LeadcodeDev deleted the feature/studio-subcommand branch September 30, 2026 15:30
@LeadcodeDev LeadcodeDev mentioned this pull request Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No rustmotion studio subcommand: the studio is only reachable as a second binary

1 participant